Port indentation code from js2-mode to js-mode
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 8 Dec 2013 16:08:45 +0000 (18:08 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 8 Dec 2013 16:08:45 +0000 (18:08 +0200)
commit5eeb53d9843d2eb7135af74d78540302d8b9e8d9
tree9690f36895493b067e772ff5b690f4ec018c5af5
parent2df52d6c45e2eec5aa1a4f6d2d8f056186a2e512
Port indentation code from js2-mode to js-mode

* lisp/progmodes/js.el (js-auto-indent-flag): Remove, was unused.
(js-switch-indent-offset): New option.
(js--proper-indentation): Use it.  And handle the case when
"default" is actually a key in an object literal.
(js--same-line): New function.
(js--multi-line-declaration-indentation): Use it.
(js--indent-in-array-comp, js--array-comp-indentation): New
functions.
(js--proper-indentation): Use them, to handle array comprehension
continuations.
etc/NEWS
lisp/ChangeLog
lisp/progmodes/js.el
test/indent/js.js [new file with mode: 0644]